
'use strict';

const ueditor = require('koa2-ueditor');
const path = require('path');
/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const subRouter = app.router.namespace('/apis');
  // curl localhost:7001/sub/test
  subRouter.get('/banners', app.controller.apis.banners);
  subRouter.get('/articles', app.controller.apis.articles);
  subRouter.get('/projects', app.controller.apis.projects);
  subRouter.get('/projectDetail', app.controller.apis.projectDetail);
  subRouter.get('/vote', app.controller.apis.vote);
  subRouter.get('/notification', app.controller.apis.notification);
  subRouter.get('/articleDetail', app.controller.apis.articleDetail);
//   subRouter.get('/login', app.controller.admin.login);
//   subRouter.get('/loginAction', app.controller.admin.loginAction);
//   subRouter.get('/banner', app.controller.admin.banner);
//   subRouter.post('/banner/add', app.controller.admin.bannerAdd);
//   subRouter.get('/consult', app.controller.admin.consult);
//   subRouter.all('/editor', ueditor(path.join(__dirname, '../public/')));
  // subRouter.get('sub_upload', '/upload', app.controller.sub.upload);

  // const subRouter = app.router.namespace('/sub/:id');
  // cont subRouter = app.router.namespace('/sub', app.middleware.jsonp());

  // output: /sub/upload
};
